package request

import (
	"time"

	"github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
	"github.com/flipped-aurora/gin-vue-admin/server/plugin/gva_intelligent_form/model"
)

// IntelligentFormSubmissionSearch 提交记录搜索结构体
type IntelligentFormSubmissionSearch struct {
	model.IntelligentFormSubmission
	StartCreatedAt *time.Time `json:"startCreatedAt" form:"startCreatedAt"`
	EndCreatedAt   *time.Time `json:"endCreatedAt" form:"endCreatedAt"`
	FormID         uint       `json:"formId" form:"formId"`
	request.PageInfo
}

// SubmitFormRequest 提交表单请求
type SubmitFormRequest struct {
	FormID     uint        `json:"formId" validate:"required"`
	SubmitData interface{} `json:"submitData" validate:"required"`
	Password   string      `json:"password"` // 表单访问密码
}

// ExportSubmissionRequest 导出提交数据请求
type ExportSubmissionRequest struct {
	FormID     uint       `json:"formId" validate:"required"`
	StartTime  *time.Time `json:"startTime"`
	EndTime    *time.Time `json:"endTime"`
	ExportType string     `json:"exportType" validate:"required,oneof=excel csv"` // excel 或 csv
}
